# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-validictory
pkgname=('python2-validictory' 'python-validictory')
_pkgname=validictory
pkgver=1.1.3
pkgrel=2
pkgdesc='General purpose Python data validator that allows validation of arbitrary Python data structures.'
arch=('any')
url='https://pypi.org/project/validictory/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('94c292c99b382d323f229e632fb7e162e8cc724d895a6f361f92ef5f737f47ccfc25e5375891d5c9c2a1bf1b23be9171c93bfc639890597c5a9832e911a06898')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-validictory() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-validictory() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

